<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE html >
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<script type="text/javascript" src="/testmybatis/jquery-2.2.4.min.js"></script>
</head>
<body>
	<div id="tips"></div>
	<table>
		<tr>
			<td>ID号码</td>
			<td><input id="user_id" /></td>
		</tr>
		<tr>
			<td>密码</td>
			<td><input type="password" id="user_pswd" /></td>
		</tr>
		<tr>
			<td><button type="button" onclick="chick()">确定</button></td>
			<td><button onclick="onregin()">注册</button></td>
		</tr>
	</table>
	<script type="text/javascript">
		function chick() {
			$.ajax({
				url : "/testmybatis/userController/login",
				type:"post",
				data : {
					id : $("#user_id").val(),
					password : $("#user_pswd").val()
				},
				dataType : "json",
				success : function(u) {
					if (u == "登陆成功") {
						window.location.href = "/testmybatis/userController/redrict";
					}
					$("#tips").empty().append(u);
				}

			});
		};

		function onregin() {
			window.location.href = "userController/onregin";
			window.open("http://www.baidu.com")

		}
	</script>
</body>
</html>